<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
	<title>编辑前端信息</title>

	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!-- 引入bootstrap -->
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/bootstrap.min.css">
	<!-- 引入JQuery  bootstrap.js-->
	<script src="<%=request.getContextPath()%>/js/jquery-3.2.1.min.js"></script>
	<script src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
	<style>
		label {
			display: block;
			width: 70px;
			height: 28px;
		}
		.mui-switch + .mui-switch-text {
			width: 100%;
			height: 100%;
			border: 1px solid blue;
			background-color: #fff;
			display: flex;
			align-items: center;
			position: relative;
		}
		.mui-switch-text:before {
			content: 'OFF';
			width: 50%;
			height: 100%;
			top: 0;
			left: 0;
			position: absolute;
			display: flex;
			align-items: center;
			justify-content: center;
			color: #fff; /*字体颜色*/
			transition: left 0.2s;
			background-color: blue; /*按钮背景*/
		}
		.mui-switch:checked + .mui-switch-text:before {
			content: 'ON';
			left: 50%;
		}
		.mui-switch + .mui-switch-text span {
			display: inline-block;
			width: 50%;
			text-align: center;
			color: #fff;
		}
		.appletstable{
			border:1px solid;
			table-layout:fixed;/* 只有定义了表格的布局算法为fixed，下面td的定义才能起作用。 */
			width:100%;
			word-break:keep-all;/* 不换行 */
			white-space:nowrap;/* 不换行 */
			overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */
			text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ；需与overflow:hidden;一起使用。*/
		}
		.wrap{
			width:80%;
			white-space: nowrap;
			text-overflow: ellipsis;
			overflow: hidden;
			text-align: center;
		}
	</style>
</head>
<body>
	<!-- 顶栏 -->
	<jsp:include page="top.jsp"></jsp:include>
	<!-- 中间主体 -->
		<div class="container" id="content">
		<div class="row">
			<jsp:include page="menu.jsp"></jsp:include>
			<div class="col-md-10">
				<div class="panel panel-default">
				    <div class="panel-heading">
						<div class="row">
					    	<h1 style="text-align: center;">修改前端信息</h1>
						</div>
				    </div>
				    <div class="panel-body">
						<form enctype="multipart/form-data" class="form-horizontal" role="form" action="<%=request.getContextPath()%>/admin/Applets/doEditSceneryApplets" id="editfrom" method="post">
							<div class="form-group ">
								<label for="copyright" class="col-sm-2 control-label" >学校名称（版权）：</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="copyright" name="copyright"  placeholder="请输入版权名称"
									<c:if test='${applets!=null}'> value="${applets.copyright}" </c:if> >
								</div>
							</div>
							<div class="form-group ">
								<label for="shortname" class="col-sm-2 control-label" >学校简称：</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="shortname" name="shortname"  placeholder="请输入简称"
									<c:if test='${applets!=null}'> value="${applets.shortname}" </c:if> >
								</div>
							</div>
							<div class="form-group ">
								<label for="description" class="col-sm-2 control-label" >学校简介：</label>
								<div class="col-sm-10">
									<textarea title="${applets.description}" class="form-control" id="description" name="description"
											  placeholder="请输入简介">${applets.description}</textarea>
								</div>
							</div>
							<div class="form-group ">
								<label for="floor" class="col-sm-2 control-label" >学校地址：</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="floor" name="floor"  placeholder="请输入学校地址"
									<c:if test='${applets!=null}'> value="${applets.floor}" </c:if> >
								</div>
							</div>
							<div class="form-group ">
								<label for="xiaoxun" class="col-sm-2 control-label" >校训：</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="xiaoxun" name="xiaoxun"  placeholder="请输入校训"
											<c:if test='${applets!=null}'> value="${applets.xiaoxun}" </c:if> >
								</div>
							</div>
							<div class="form-group ">
								<label for="longitude" class="col-sm-2 control-label" >经度：</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="longitude" name="longitude"  placeholder="请输入经度"
									<c:if test='${applets!=null}'> value="${applets.longitude}" </c:if> >
								</div>
							</div>
							<div class="form-group ">
								<label for="latitude" class="col-sm-2 control-label" >纬度：</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="latitude" name="latitude"  placeholder="请输入纬度"
									<c:if test='${applets!=null}'> value="${applets.latitude}" </c:if> >
								</div>
							</div>
							<div class="form-group ">
								<label for="images" class="col-sm-2 control-label" >首页背景：</label>
								<div class="col-sm-10">
									<input type="file" name="file">
									<img width="50px" height="50px" id="images" alt="Marker图标" src="/image/${applets.background}">
								</div>
							</div>
							<div class="form-group ">
								<label for="videofile" class="col-sm-2 control-label" >视频：</label>
								<div class="col-sm-10">
									<input type="file" name="videofile" id="videofile">
								</div>
							</div>
							<div class="form-group ">
								<label class="col-sm-2 control-label" >评论功能：</label>
								<div class="col-sm-10">
									<div class="col-sm-10">
										<input style="display: none" value="${applets.mycomment}" id="applets" type="text">
										<label class="checkbox-inline">
											<input type="radio" name="mycomment" value="开">开
										</label>
										<label class="checkbox-inline">
											<input type="radio" name="mycomment" value="">关
										</label>
									</div>
								</div>
							</div>
							<div class="form-group" style="text-align: center">
								<button class="btn btn-default" type="submit">提交</button>
								<button class="btn btn-default" type="reset">重置</button>
							</div>
						</form>
				    </div>

				</div>

			</div>
		</div>
	</div>
	<div class="container" id="footer">
	<div class="row">
		<div class="col-md-12"></div>
	</div>
	</div>
</body>
	<script type="text/javascript">
		//1
		$("#nav li:nth-child(5)").addClass("active");

		//2
		var val=document.getElementById("applets").value;
		$(":radio[name='mycomment'][value='" + val + "']").prop("checked", "checked");
	</script>
</html>